/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author fikri
 */
@Entity
@Table(name = "kod_respon")
@NamedQueries({
    @NamedQuery(name = "KodRespon.findAll", query = "SELECT k FROM KodRespon k")})
public class KodRespon implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected KodResponPK kodResponPK;
    @Column(name = "mesej")
    private String mesej;
    

        @Embedded
    private InfoAudit infoAudit;

    public KodRespon() {
    }

    public KodRespon(KodResponPK kodResponPK) {
        this.kodResponPK = kodResponPK;
    }


    public KodRespon(String kod, String msgId) {
        this.kodResponPK = new KodResponPK(kod, msgId);
    }

    public KodResponPK getKodResponPK() {
        return kodResponPK;
    }

    public void setKodResponPK(KodResponPK kodResponPK) {
        this.kodResponPK = kodResponPK;
    }

    public String getMesej() {
        return mesej;
    }

    public void setMesej(String mesej) {
        this.mesej = mesej;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }
    
    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (kodResponPK != null ? kodResponPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof KodRespon)) {
            return false;
        }
        KodRespon other = (KodRespon) object;
        if ((this.kodResponPK == null && other.kodResponPK != null) || (this.kodResponPK != null && !this.kodResponPK.equals(other.kodResponPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.KodRespon[ kodResponPK=" + kodResponPK + " ]";
    }
    
}
